3.1.27 \(\int (a+i a \tan (c+d x))^3 \, dx\) [27]

Optimal. Leaf size=63 \[ 4 a^3 x-\frac {4 i a^3 \log (\cos (c+d x))}{d}-\frac {2 a^3 \tan (c+d x)}{d}+\frac {i a (a+i a \tan (c+d x))^2}{2 d} \]

[Out]

4*a^3*x-4*I*a^3*ln(cos(d*x+c))/d-2*a^3*tan(d*x+c)/d+1/2*I*a*(a+I*a*tan(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3559, 3558, 3556} \begin {gather*} -\frac {2 a^3 \tan (c+d x)}{d}-\frac {4 i a^3 \log (\cos (c+d x))}{d}+4 a^3 x+\frac {i a (a+i a \tan (c+d x))^2}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[c + d*x])^3,x]

[Out]

4*a^3*x - ((4*I)*a^3*Log[Cos[c + d*x]])/d - (2*a^3*Tan[c + d*x])/d + ((I/2)*a*(a + I*a*Tan[c + d*x])^2)/d

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3558

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2)*x, x] + (Dist[2*a*b, Int[Tan[c + d
*x], x], x] + Simp[b^2*(Tan[c + d*x]/d), x]) /; FreeQ[{a, b, c, d}, x]

Rule 3559

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))
), x] + Dist[2*a, Int[(a + b*Tan[c + d*x])^(n - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && G
tQ[n, 1]

Rubi steps

\begin {align*} \int (a+i a \tan (c+d x))^3 \, dx &=\frac {i a (a+i a \tan (c+d x))^2}{2 d}+(2 a) \int (a+i a \tan (c+d x))^2 \, dx\\ &=4 a^3 x-\frac {2 a^3 \tan (c+d x)}{d}+\frac {i a (a+i a \tan (c+d x))^2}{2 d}+\left (4 i a^3\right ) \int \tan (c+d x) \, dx\\ &=4 a^3 x-\frac {4 i a^3 \log (\cos (c+d x))}{d}-\frac {2 a^3 \tan (c+d x)}{d}+\frac {i a (a+i a \tan (c+d x))^2}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.77, size = 119, normalized size = 1.89 \begin {gather*} \frac {a^3 \sec (c) \sec ^2(c+d x) \left (2 d x \cos (3 c+2 d x)+\cos (c+2 d x) \left (2 d x-i \log \left (\cos ^2(c+d x)\right )\right )+\cos (c) \left (-i+4 d x-2 i \log \left (\cos ^2(c+d x)\right )\right )-i \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )+3 \sin (c)-3 \sin (c+2 d x)\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[c + d*x])^3,x]

[Out]

(a^3*Sec[c]*Sec[c + d*x]^2*(2*d*x*Cos[3*c + 2*d*x] + Cos[c + 2*d*x]*(2*d*x - I*Log[Cos[c + d*x]^2]) + Cos[c]*(
-I + 4*d*x - (2*I)*Log[Cos[c + d*x]^2]) - I*Cos[3*c + 2*d*x]*Log[Cos[c + d*x]^2] + 3*Sin[c] - 3*Sin[c + 2*d*x]
))/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 51, normalized size = 0.81

method result size
derivativedivides \(\frac {a^{3} \left (-3 \tan \left (d x +c \right )-\frac {i \left (\tan ^{2}\left (d x +c \right )\right )}{2}+2 i \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+4 \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(51\)
default \(\frac {a^{3} \left (-3 \tan \left (d x +c \right )-\frac {i \left (\tan ^{2}\left (d x +c \right )\right )}{2}+2 i \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+4 \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(51\)
norman \(4 a^{3} x -\frac {3 a^{3} \tan \left (d x +c \right )}{d}-\frac {i a^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {2 i a^{3} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) \(59\)
risch \(-\frac {8 a^{3} c}{d}-\frac {2 i a^{3} \left (4 \,{\mathrm e}^{2 i \left (d x +c \right )}+3\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(67\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*a^3*(-3*tan(d*x+c)-1/2*I*tan(d*x+c)^2+2*I*ln(1+tan(d*x+c)^2)+4*arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 76, normalized size = 1.21 \begin {gather*} a^{3} x + \frac {3 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{3}}{d} + \frac {i \, a^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} + \frac {3 i \, a^{3} \log \left (\sec \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

a^3*x + 3*(d*x + c - tan(d*x + c))*a^3/d + 1/2*I*a^3*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d + 3*
I*a^3*log(sec(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 97, normalized size = 1.54 \begin {gather*} -\frac {2 \, {\left (4 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i \, a^{3} + 2 \, {\left (i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

-2*(4*I*a^3*e^(2*I*d*x + 2*I*c) + 3*I*a^3 + 2*(I*a^3*e^(4*I*d*x + 4*I*c) + 2*I*a^3*e^(2*I*d*x + 2*I*c) + I*a^3
)*log(e^(2*I*d*x + 2*I*c) + 1))/(d*e^(4*I*d*x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Sympy [A]
time = 0.17, size = 94, normalized size = 1.49 \begin {gather*} - \frac {4 i a^{3} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 8 i a^{3} e^{2 i c} e^{2 i d x} - 6 i a^{3}}{d e^{4 i c} e^{4 i d x} + 2 d e^{2 i c} e^{2 i d x} + d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))**3,x)

[Out]

-4*I*a**3*log(exp(2*I*d*x) + exp(-2*I*c))/d + (-8*I*a**3*exp(2*I*c)*exp(2*I*d*x) - 6*I*a**3)/(d*exp(4*I*c)*exp
(4*I*d*x) + 2*d*exp(2*I*c)*exp(2*I*d*x) + d)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 118 vs. \(2 (55) = 110\).
time = 0.50, size = 118, normalized size = 1.87 \begin {gather*} -\frac {2 \, {\left (2 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 4 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 4 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 3 i \, a^{3}\right )}}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-2*(2*I*a^3*e^(4*I*d*x + 4*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 4*I*a^3*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*
I*c) + 1) + 4*I*a^3*e^(2*I*d*x + 2*I*c) + 2*I*a^3*log(e^(2*I*d*x + 2*I*c) + 1) + 3*I*a^3)/(d*e^(4*I*d*x + 4*I*
c) + 2*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Mupad [B]
time = 3.68, size = 41, normalized size = 0.65 \begin {gather*} -\frac {a^3\,\left (6\,\mathrm {tan}\left (c+d\,x\right )-\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,8{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}\right )}{2\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)*1i)^3,x)

[Out]

-(a^3*(6*tan(c + d*x) - log(tan(c + d*x) + 1i)*8i + tan(c + d*x)^2*1i))/(2*d)

________________________________________________________________________________________